package com.ruoyi.system.apiController;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.YySchedule;
import com.ruoyi.system.service.IYyScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 医生排班接口
 */
@RestController
@RequestMapping("/api/schedule")
public class YyScheduleApiController {
    @Autowired
    private IYyScheduleService yyScheduleService;

    /**
     * 查询所有医生排班信息
     * @param yySchedule
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list(@RequestBody YySchedule yySchedule){
        List<Map<String,Object>> list = yyScheduleService.selectYyScheduleList2(yySchedule);
        return AjaxResult.success(list);
    }

    /**
     * 根据医生id和排班日期查看个人排班信息以及预约情况
     */
    @GetMapping("/getSchedule")
    public AjaxResult getSchedule(Integer id,String date){
        List<Map<String,Object>> list = yyScheduleService.selectYyScheduleList3(id,date);
        return AjaxResult.success(list);
    }

}
